package com.example.mylearn.proxy.learn.once.dynamicProxy.cglibProxy;

import org.springframework.cglib.proxy.Enhancer;

public class CglibProxyFactory {

    public static Object getProxy(Class<?> clazz) {
        final Enhancer enhancer = new Enhancer();
        enhancer.setClassLoader(clazz.getClassLoader());
        enhancer.setSuperclass(clazz);
        enhancer.setCallback(new CallKafkaMethodInterceptor());
        return enhancer.create();
    }



}
